<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>自定义表单导出</title>
    <#include "/pubHeadStyle.html">
    <link rel="stylesheet" href="${ctx}/css/form.css">
</head>
<body>
<form action="" class="layui-form" style="padding:5px;height: 100%;background: #fff;">
    <div class="exportTable">
        <div class="layui-form-item" style="border-top:1px solid #ccc;">
            <div class="layui-input-inline">
                 <label class="layui-form-label">自定义表单:</label>
                <div name="bpmFormDef" class="layui-unselect layui-form-checkbox layui-form-checked layui-checkbox-disbaled layui-disabled" lay-skin="primary"><i class="layui-icon layui-icon-ok" style="background: #bbb"></i></div>
            </div>
            <div class="layui-input-inline">
                <label class="layui-form-label">对应的自定义表:</label>
                <input type="checkbox" name="bpmFormTable" id="bpmFormTable" lay-skin="primary">
            </div>
        </div>
        <div class="layui-form-item item-first">
            <div class="layui-input-inline">
                <label class="layui-form-label">其它版本的自定义表单:</label>
                <input type="checkbox" name="bpmFormDefOther" id="bpmFormDefOther" lay-skin="primary" checked>
            </div>
            <div class="layui-input-inline">
                <label class="layui-form-label">表单权限:</label>
                <input type="checkbox" name="bpmFormRights" id="bpmFormRights" lay-skin="primary" checked>
            </div>
        </div>
        <div class="layui-form-item item-first">
            <div class="layui-input-inline">
                <label class="layui-form-label">数据模板:</label>
                <input type="checkbox" name="bpmTableTemplate" id="bpmTableTemplate" lay-skin="primary" checked>
            </div>
            <div class="layui-input-inline">
                <label class="layui-form-label">业务设置:</label>
                <input type="checkbox" name="sysBusEvent" id="sysBusEvent" lay-skin="primary" checked>
            </div>
        </div>
    </div>

<div class="layui-form-item" style="border:none;margin-top:20px;">
    <div class="layui-input-block" style="margin:0">
        <div class="layui-footer" style="text-align: center;position: absolute;left: 35%;top:38px;">
            <button type="button" class="layui-btn layui-btn-sm" id="export">导出</button>
            <button type="button" class="layui-btn layui-btn-sm layui-btn-danger" id="returnExp">取消</button>
        </div>
    </div>
</div>
    </form>
<script>
    layui.config({
        base: serverPath.formPath + staticPath.formPath //静态资源所在路径
    }).extend({
        index: 'index' //主入口模块
    }).use(['index', 'layer', 'jquery', 'form', 'setter'], function () {
        var $ = layui.$;
        var form = layui.form;
        var setter = layui.setter;
        form.render();
        var index = parent.layer.getFrameIndex(window.name);
        $('#returnExp').click(function () {
            parent.layer.close(index);
        });

        var formDefIds = "${formDefIds}";
        $('#export').click(function () {
            var bpmFormTable = document.getElementById("bpmFormTable").checked;
            var bpmFormDefOther = document.getElementById("bpmFormDefOther").checked;
            var bpmFormRights = document.getElementById("bpmFormRights").checked;
            var bpmTableTemplate = document.getElementById("bpmTableTemplate").checked;
            var sysBusEvent = document.getElementById("sysBusEvent").checked;
            var url = serverPath.formPath + setter.formLinkPath +"formDef/exportXml?formDefIds="+formDefIds+"&bpmFormTable="+bpmFormTable+"&bpmFormDefOther="+bpmFormDefOther+"&bpmFormRights="+bpmFormRights+"&bpmTableTemplate="+bpmTableTemplate+"&sysBusEvent="+sysBusEvent;
            window.location.href = url;
        })
    })
</script>
</body>
</html>